package com.biaobiaoqi.scoreanalysis.administrator.action;

import java.util.Map;

import javax.annotation.Resource;

import org.apache.struts2.interceptor.SessionAware;

import com.biaobiaoqi.scoreanalysis.hibernate.bean.Administrator;
import com.biaobiaoqi.scoreanalysis.service.IAdministratorService;
import com.opensymphony.xwork2.ActionSupport;

public class EditAdminInfo extends ActionSupport implements SessionAware{
 	/**
	 * 
	 */
	private static final long serialVersionUID = 1080129986690110188L;
	private String loginName;
  	private String userName;
	private String email;
	private Map<String, Object> session;

 
	@Resource
 	private IAdministratorService administratorService;

	public String execute() {
		Administrator administrator = administratorService.getAdministrator((Integer)session.get("userId"));
		loginName = administrator.getLoginName();
		userName = administrator.getName();
		email   = administrator.getEmail();
 		return SUCCESS;
	}

	public IAdministratorService getAdministratorService() {
		return administratorService;
	}

	public void setAdministratorService(
			IAdministratorService administratorService) {
		this.administratorService = administratorService;
	}

 
	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

  
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
 	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Override
	public void setSession(Map<String, Object> session) {
		this.session = session;
	}
}
